<template>
  <div class="sliding-switch-box">
    <a href='#' class='btn'>
      <span><i class='bx bx-right-arrow-alt'></i></span>
      前往下一步
    </a>
  </div>
</template>

<script lang="ts" setup>

</script>

<style scoped lang="less">
.sliding-switch-box {
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #28272a;

  .btn {
    position: relative;
    width: 200px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.25);
    text-decoration: none;
    letter-spacing: 2px; //字母间隔
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    padding-left: 40px;
    transition: 0.5s;
    overflow: hidden;
  }

  .btn:hover {
    padding-left: 0;
    padding-right: 40px;
    color: rgba(255, 255, 255, 1);
  }

  .btn span {
    position: absolute;
    left: 5px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #04fe4d;
    color: #000;
    transition: 0.5s ease-in-out;
    font-size: 2.5em;
    text-align: center;
  }

  .btn:hover span {
    left: calc(100% - 55px)
  }

  .btn:after {
    content: '';
    position: absolute;
    width: 80px;
    height: 100%;
    z-index: 1;
    background: rgba(255, 255, 255, 0.5);
    transform: translateX(-170px) skewX(30deg);
    transition: 0.75s ease-in-out;
  }

  .btn:hover:after {
    transform: translateX(170px) skewX(30deg);
  }
}
</style>